package com.lening.iot.controller;

import com.lening.iot.po.Community;
import com.lening.iot.service.CommunityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ToDo:
 * @Author：李忠达
 * @date: 2024/6/20 20:53
 */
@RestController
@RequestMapping("/communities")
public class CommunityController {
    @Autowired(required = false)
    private CommunityService communityService;

    @GetMapping("/{cid}")
    public Community getCommunityById(@PathVariable Long cid) {
        return communityService.getCommunityById(cid); // 假设 Service 层有该方法
    }
}
